Skip to content

core: expose v2 model listing API#25821

Open
thdxr wants to merge 22 commits into
devfrom
feature/v2-plugin-model-api
Open

core: expose v2 model listing API#25821
thdxr wants to merge 22 commits into
devfrom
feature/v2-plugin-model-api

Conversation

@thdxr
Copy link
Copy Markdown
Member

@thdxr thdxr commented May 5, 2026

Summary

  • Exposes a v2 model listing endpoint so clients can discover available AI models programmatically.
  • Includes model pricing, capability, provider, and variant details in the generated JavaScript SDK.
  • Aligns v2 model naming around ModelV2 so session events and messages use the same schema identity.

Testing

  • Not run; commit was created before this PR request.

Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@thdxr thdxr requested a review from adamdotdevin as a code owner May 6, 2026 17:56
@thdxr thdxr force-pushed the feature/v2-plugin-model-api branch 5 times, most recently from 6349313 to 24404af Compare May 9, 2026 20:15
@thdxr thdxr removed the request for review from adamdotdevin May 9, 2026 20:15
@thdxr thdxr force-pushed the feature/v2-plugin-model-api branch 3 times, most recently from 0f13128 to 9cc6304 Compare May 11, 2026 00:34
@thdxr thdxr force-pushed the feature/v2-plugin-model-api branch from 9cc6304 to 4b56dae Compare May 11, 2026 04:54
@thdxr
Copy link
Copy Markdown
Member Author

thdxr commented May 12, 2026

Fixed the CI failures in packages/opencode/src/server/routes/instance/httpapi/event.ts.

The failing SDK instance event stream test was hitting a lazy bus.subscribeAll() after the request middleware instance context had already unwound. I changed the instance SSE handler to subscribe while still inside the handler/request context, forward bus events through a Queue, and clean up by unsubscribing/shutting down the queue when the stream closes.

Verified locally after merging latest dev:

  • bun test --timeout 30000 test/server/httpapi-sdk.test.ts -t "matches generated SDK instance event stream"
  • bun test --timeout 30000 test/server/worktree-endpoint-repro.test.ts
  • bun test --timeout 30000 test/server/httpapi-cors.test.ts -t "uses custom CORS origins passed to the server"

Also passed bun turbo typecheck during push.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant